<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Send Video Lists</title>
    <script>
        function sendVideoLists() {
            // 定义服务器地址
            const serverBase = 'http://10.127.38.150:';
            // 定义端口列表
            const ports = [5001, 5002, 5003, 5004, 5005, 5031, 5032, 5033, 5034, 5035];
            // 定义要发送的数据
            const videoLists = [
                'http://example.com/video1.mp4',
                'http://example.com/video2.mp4',
                'http://example.com/video3.mp4'
            ];

            // 遍历端口，发送数据
            ports.forEach(port => {
                // 创建XHR对象
                const xhr = new XMLHttpRequest();
                // 初始化HTTP请求
                xhr.open('POST', serverBase + port, true);
                // 设置发送的数据类型为JSON
                xhr.setRequestHeader('Content-Type', 'application/json');
                // 发送数据
                xhr.send(JSON.stringify(videoLists));

                // 处理响应
                xhr.onload = function() {
                    if (xhr.status >= 200 && xhr.status < 300) {
                        console.log('Data sent successfully to port ' + port);
                    } else {
                        console.error('Failed to send data to port ' + port);
                    }
                };
            });
        }
    </script>
</head>
<body>
    <button onclick="sendVideoLists()">Send Video Lists</button>
</body>
</html>
